package com.ruoyi.web.cp.domain.rm;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @TableName RM_CHAT_SHOW
 */
@Data
@NoArgsConstructor
public class RmChatShow {
    private Long id;
    private String gameId;
    private String marketId;
    private JSONArray details;
    private String detailsJson;

    private RmResult rmResult = new RmResult();

    public RmChatShow(String gameId, String marketId) {
        this.gameId = gameId;
        this.marketId = marketId;
        this.details = new JSONArray();
    }

    public RmChatShow(String gameId, String marketId, String detailsJson) {
        this.gameId = gameId;
        this.marketId = marketId;
        this.detailsJson = detailsJson;
    }

    public String getDetailsJson() {
        return JSON.toJSONString(this.details);
    }

    public JSONArray getDetailsJsonToArray() {
        return JSON.parseArray(this.detailsJson);
    }

    @Data
    public static class Detail {
        private String score;
        private String chat;

        public Detail(String score, String chat) {
            this.score = score;
            this.chat = chat;
        }
    }
}